package nl.hu.modellingengine.menu.client.activity;

import nl.hu.modellingengine.client.ClientFactory;
import nl.hu.modellingengine.client.place.InitPlace;
import nl.hu.modellingengine.menu.client.MenuFactory;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;

public class MenuActivityMapper implements ActivityMapper {
	
	private ClientFactory clientFactory;
	private MenuFactory menuFactory;
	
	public MenuActivityMapper(ClientFactory clientFactory,MenuFactory menuFactory){
		super();
		this.clientFactory = clientFactory;
		this.menuFactory = menuFactory;
	}

	@Override
	public Activity getActivity(Place place) {
		if(place instanceof Place){
			return new MenuInitActivity(place,clientFactory,menuFactory);
		}
		return null;
	}

}
